export class MessageModel{
    constructor(msg){
       if(Object.prototype.toString.call(msg).slice(8,-1) === 'Object'){
        this.id = msg.id
        this.from = msg.from || 0  //0自己 1对方
        this.type = msg.type || 0 //0 文字 1图片 2语音 3link 4评价 5 验证
        this.time = msg.time
        this.content = msg.content || ''
        this.toolUrl =  msg.toolUrl || ''
        this.comment = msg.comment || ''
       }else{
        this.id = new Date().getTime()
        this.from =  0
        this.type = 0
        this.time = new Date().getTime()
        this.content =  ''
        this.toolUrl =  ''
       }
   }
}